package com.stars.empoly.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.stars.empoly.base.MBActivity
import com.stars.empoly.config.MIntentAction
import com.stars.empoly.databinding.ActivityWithdrawalBinding
import com.stars.empoly.vmodel.WithdrawalVModel

/**
 *
 *on 2020/9/23
 */
class WithdrawalActivity : MBActivity<WithdrawalVModel, ActivityWithdrawalBinding>(){


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        vm.canUseMoney.value=intent?.extras?.getString("money", "")
        vm.getBankInfo()
        vm.reqTips()
    }
    override fun binding(): ActivityWithdrawalBinding {
       return ActivityWithdrawalBinding.inflate(layoutInflater)
    }

    override fun vmClass(): Class<WithdrawalVModel> {
        return WithdrawalVModel::class.java
    }

    override fun title(): String? {
        return "提现"
    }
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if(MIntentAction.REQUEST_CODE_ONE == requestCode && resultCode == Activity.RESULT_OK){
            vm.getBankInfo()//刷新银行卡
        }
    }
}
